package cn.xiaopengstack.domain.activity.repository;

import cn.xiaopengstack.domain.activity.model.entity.GroupBuyActivityEntity;
import cn.xiaopengstack.domain.activity.model.entity.GroupBuyOrderDetailEntity;
import cn.xiaopengstack.domain.activity.model.entity.QueryInProgressGroupBuyOrderEntity;
import cn.xiaopengstack.domain.activity.model.entity.TeamStatisticEntity;
import cn.xiaopengstack.domain.activity.model.valobj.CrowTagDetailVO;
import cn.xiaopengstack.domain.activity.model.valobj.GroupBuyActivityDiscountVO;
import cn.xiaopengstack.domain.activity.model.valobj.SkuVO;

import java.util.List;

/**
 * @author jiangyangang
 */
public interface IActivityRepository {

    /**
     * 查询活动商品折扣
     * @param source
     * @param channel
     * @return
     */
    GroupBuyActivityDiscountVO queryGroupBuyActivityDiscountVO(String source, String channel);

    /**
     * 查询商品信息
     * @param goodsId
     * @return
     */
    SkuVO querySkuByGoodsId(String goodsId);

    /**
     * 查询标签详情
     * @param userId
     * @param tagId
     * @return
     */
    CrowTagDetailVO queryUserTagDetailVO(String userId, String tagId);

    /**
     * 查询拼团活动
     * @param activityId
     * @return
     */
    GroupBuyActivityEntity queryGroupBuyActivityEntityByActivityId(Long activityId);

    /**
     * 查询用户参与的活动次数
     * @param activityId
     * @param userId
     * @return
     */
    Integer queryOrderCountByActivityId(Long activityId, String userId);

    /**
     * 查询指定数量处于拼团中的拼团订单
     * 按照拼团剩余时间排序
     * @param queryInProgressGroupBuyOrderEntity
     * @return
     */
    List<GroupBuyOrderDetailEntity> queryInProgressGroupOrderList(QueryInProgressGroupBuyOrderEntity queryInProgressGroupBuyOrderEntity);

    /**
     * 查询指定数量处于拼团中的拼团订单
     * 随机获取拼团订单
     * @param queryInProgressGroupBuyOrderEntity
     * @return
     */
    List<GroupBuyOrderDetailEntity> queryInProgressGroupOrderListRandom(QueryInProgressGroupBuyOrderEntity queryInProgressGroupBuyOrderEntity);

    /**
     * 查询队伍详情
     * @param activityId
     * @param goodsId
     * @return
     */
    TeamStatisticEntity queryTeamStatistic(Long activityId, String goodsId);
}
